<?php
class folder_language extends Model{
	public static function getTableName(){
		return 'folder-language';
	}

	public function set($object){
		$this->language_id= !isset($object->language_id) ? '0' : $object->language_id;
		$this->title= !isset($object->title) ? '' : $object->title;
		$this->subtitle= !isset($object->subtitle) ? '' : $object->subtitle;
		$this->description= !isset($object->description) ? '' : $object->description;
	}

	/*
	 * by donald
	 */
	public function getAll(array $params)
	{
		foreach ($params as $field => $value) {
			switch ($field) {
				case 'folder_id':
					$where[] = 'folder_id = ?';
					$where_array[] = $value;
					break;
			}
		}

		return self::$dbo['w']->find(__CLASS__, implode(' AND ', $where), $where_array);
	}
}
?>
